﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace RepositorioDeMonografia
{
    public partial class CadastrarMonografia : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {

        }

        protected void Button2_Click(object sender, EventArgs e)
        {

        }

        protected void Button3_Click(object sender, EventArgs e)
        {
            if (!FileUpload1.HasFile)
            {
                LabelInfo.Text = "Por favor carregue o arquivo.";
            }

            else
            {

                if (FileUpload1.HasFile)

                    try
                    {
                        FileUpload1.SaveAs("C:\\CESED\\Monografias\\" + FileUpload1.FileName);

                        LabelInfo.Text = "Nome do arquivo: " +
                        FileUpload1.PostedFile.FileName + "<br>" +
                        FileUpload1.PostedFile.ContentLength + "kb <br>" +
                        FileUpload1.PostedFile.ContentType;
                    }
                    catch (Exception ex)
                    {
                        LabelInfo.Text = " ERRO: " + ex.Message.ToString();
                    }
                else
                {
                    LabelInfo.Text = "Selecione o arquivo. ";
                }
            }

        }
        }
    }
